London | ITP- Jan- 2026 | Ping Wang | Sprint 1 | coursework#928
London | ITP- Jan- 2026 | Ping Wang | Sprint 1 | coursework#928pathywang wants to merge 37 commits intoCodeYourFuture:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| let initials = firstName[0]+middleName[0]+lastName[0]; | ||
|
|
||
| console.log(initials) |
There was a problem hiding this comment.
Yes, your code runs with the desired output, but it is best practice to try to follow the provided template for you in the task. A variable was initialised as a template literal, but your solution provides another way to do it.
Sprint-1/1-key-exercises/3-paths.js
Outdated
| console.log(`The dir part of ${filePath} is ${dir}`); | ||
| console.log(`The ext part of ${filePath} is ${ext}`); |
There was a problem hiding this comment.
Achieved the right output. But it might be best practice to not include the filePath in your console.log to make the output more readable.
Sprint-1/1-key-exercises/4-random.js
Outdated
| // Try logging the value of num and running the program several times to build an idea of what the program is doingnum reprents the number is randomly generated whole number betweeb 1 and 100,inclusive range is between 0 and 99.99999 | ||
|
|
||
| //Math.random() returns a random decimal between 0(inclusive) and 1(exclusive). while maximum-minimum +1=100, Math.random()*(maximum-minimum+1) | ||
|
|
||
| //Due to that Math.floor(...) rounds down the decimal to the nearest whole number.From this Stage, we have interger between o and 99.After + minimum, the range is between 1 and 100. | ||
| //This is classcial expressions for generating a random integer between two values- between 1 and 100, inclusive in this function. | ||
| //This kind of expression is commonly used for things like: rolling dice,random quiz questions, game mechanics. |
There was a problem hiding this comment.
Good breakdown, but it can be better improved by beginning with the operation in the parenthesis first.
Sprint-1/2-mandatory-errors/0.js
Outdated
| // This is just an instruction for the first activity - but it is just for human consumption | ||
| // We don't want the computer to run these 2 lines - how can we solve this problem? | ||
|
|
||
| In JavaScript, we put // in front of sentence which is only for human to read. No newline at end of file |
There was a problem hiding this comment.
Correct. But, don't you think the whole of line 4 should be a comment?
| const cardNumber=4533787178994213; | ||
|
|
||
| //then convert to string | ||
| const last4Digits = cardNumber.toString().slice(-4); | ||
| console.log(last4Digits); | ||
|
|
||
| // or i can put quotes on cardNumber which will be string | ||
| const cardNumber1 ="4533787178994213" | ||
| const last4Digits1 = cardNumber1.slice(-4); | ||
| console.log(last4Digits1) No newline at end of file |
There was a problem hiding this comment.
Good initiative shown by executing the task in more than one way.
| //a: There are three function calls, which are: Number(...), replaceAll(...) and console.log(...) | ||
| // Function call lines: 1. carPrice = Number(carPrice.replaceAll(",", "")); | ||
| // 2. priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," "")); | ||
| // 3. console.log(`The percentage change is ${percentageChange}`); |
There was a problem hiding this comment.
Yes, the function call lines are right. But, look at each line again and see if there are some repeated method calls that might increase your current number.
| // Answer e: this builds a string representing the time in HH:MM:SS format, based on the movie length in seconds. The better name can be | ||
| // formattedTime or timeString. |
There was a problem hiding this comment.
A name with the existing code context would be better practice.
Sprint-1/4-stretch-explore/chrome.md
Outdated
| >let myName = prompt("What is your name?"); | ||
| the pop up box:chrome://new-tab-page says, i ignore blue box just press cancel, | ||
| <.console.log("Your name is:", myName); | ||
| VM255:2 Your name is: null | ||
| undefined | ||
| >let myName = prompt("What is your name?"); | ||
| in pop up box: chrome://new-tab-page says, i put my name'ping' in blue box then press ok | ||
| <.console.log("Your name is:", myName); | ||
| VM259:2 Your name is: ping | ||
| undefined | ||
| The value returned from prompt() is stored in the variable myName. The pop up box pauses the JS execution until i press the button either'cancel' or put my name before press'OK'. |
There was a problem hiding this comment.
You need to grant the required permissions on your computer before running this on your chrome devtools. That way, you will get the right output and document it properly.
Theoreoluwa
left a comment
There was a problem hiding this comment.
Well done. Please, look at the comments made and make the necessary adjustments as soon as you can. Rooting for you!
Self checklist
Changelist
i completed task as required and checked with Node as many as i can in order to fully understand the concepts and knowledge